package com.remontee.mecanique.mvc;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.WindowConstants;

import com.remontee.mecanique.mvc.controller.ConfigController;
import com.remontee.mecanique.mvc.model.ConfigurationModel;
import com.remontee.mecanique.mvc.view.ConfigViewPanel;
import com.remontee.mecanique.mvc.view.RemonteeViewPanel;

/**
 * @author Michel
 */
public class Main {

	/** Creates a new instance of Main */
	public Main() {

		ConfigurationModel configModel = new ConfigurationModel();
		
		ConfigController controller = new ConfigController();

		RemonteeViewPanel remonteeViewPanel = new RemonteeViewPanel(controller);
		ConfigViewPanel configViewPanel = new ConfigViewPanel(controller);

		controller.addView(remonteeViewPanel);
		controller.addView(configViewPanel);
		controller.addModel(configModel);
		
		configModel.initDefault();

		JFrame displayFrame = new JFrame("Remontee Mecanique");
		displayFrame.getContentPane().add(remonteeViewPanel,
				BorderLayout.CENTER);
		displayFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		displayFrame.pack();

		displayFrame.setVisible(true);

	}

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String[] args) {
		Main main = new Main();
	}

}
